package com.example.cloud.service.finance.impl;

import com.example.cloud.dao.finance.PaymentDetailsRepository;
import com.example.cloud.model.finance.PaymentDetails;
import com.example.cloud.service.finance.PaymentDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.List;

/**
 * Created by wangtao on 2018/5/22.
 */
@Service
public class PaymentDetailsServiceImpl implements PaymentDetailsService {

    @PersistenceContext
    EntityManager em;

    @Autowired
    private PaymentDetailsRepository paymentDetailsRepository;

    @Override
    public List<PaymentDetails> findByRecordId(Long recordId, int type) {
        return paymentDetailsRepository.findAllByRecordIdAndRecordType(recordId, type);
    }
}
